<?php
    //include_once 'init.php';
    if(!empty($_POST)){
        // $username=$_POST['username'];//用户名
        // $password=$_POST['password'];//密码
        // $password1=$_POST['password1'];//确认密码
        // $email=$_POST['email'];//邮箱
        // $phone=$_POST['phone'];//手机
        // $creat_time=time();//创建时间
        // if($password!=$password1){
        //     echo '<script>alert("两次输入的密码不一致");history.go(-1);</script>';die;
        // }
        // $password=md5($password);
        // $where['username']=$username;
        // $where['password']=$password;
        // $where['email']=$email;
        // $where['phone']=$phone;
        // $where['creat_time']=$creat_time;

        //$_POST['power']=implode(',',$_POST['power']);

        $result=add($c,$_POST);
            if($result>0){
                echo '<script>alert("管理员添加成功");location.href="index.php?c=power&a=list&admin=1";</script>';die;
            }else{
                echo '<script>alert("管理员添加失败");history.go(-1);</script>';die;
            }

    }
    $data=getSelect($c,'*','pid = 0');
    include(VIEW_PATH.$admin.'layout.html');
?>